package com.example.controller;

import com.example.service.HistoryService;
import com.example.utils.Result;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RestController
@RequestMapping("/history")
@Api(tags = "浏览量")
public class HistoryController {
    @Autowired
    private HistoryService historyService;

    @GetMapping("/count1")
    public Result count1(){
        int count = historyService.count1();
        return new Result<>("200", "酒店浏览量", count);
    }

    @GetMapping("/count2")
    public Result count2(){
        int count = historyService.count2();
        return new Result<>("200", "景点浏览量", count);
    }
}
